package com.thread.example.controller;

import com.thread.example.service.UseThreadPoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/threadPool")
public class UseThreadPoolController {

    @Autowired
    private UseThreadPoolService useThreadPoolService;

    @RequestMapping("/{capacity}")
    public void threadPool(@PathVariable("capacity") int capacity) {
        useThreadPoolService.executeService(capacity);
    }

}
